#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTextCursor>
#include <QTextStream>
#include <QFileDialog>
#include <QTextDocument>
#include <QFontDialog>
#include <QMessageBox>
#include <QDebug>
#include "HighLight.h"
#include "Controls/codeeditor.h"


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void initUIs();
    void initCheckStates();

    void resetOri();

    void replaceChar(QChar c);
    void replaceIndex(int n);

    QString SplitLine(int n);
    QString removeStr(QString);

    bool OpenSeleteFile();
private slots:
    void on_actionApply_triggered();

    void on_tb_open_clicked();

    void on_cb_time_clicked(bool checked);

    void on_actionFont_triggered();

    void on_cb_space_clicked(bool checked);

    void on_cb_abc_clicked(bool checked);

    void on_cb_1_clicked(bool checked);

    void on_tb_find_clicked();

    void on_cb_2_clicked(bool checked);

    void on_actionSaveAs_triggered();

private:
    Ui::MainWindow *ui;

    QTextStream origin; //
    QTextStream shows; //

    QString LastStr;

    CodeEditor *textBrowser;
};
#endif // MAINWINDOW_H
